<template>
    <div>
        <el-breadcrumb separator="/">
            <el-breadcrumb-item style="font-size: 18px;">采集任务</el-breadcrumb-item>
        </el-breadcrumb>
        <el-divider></el-divider>
        <el-table :data="tableData" stripe style="width: 100%;" border>
            <el-table-column prop="taskName" label="任务名称" align="center">
            </el-table-column>
            <el-table-column prop="createUser" label="创建用户" align="center">
            </el-table-column>
            <el-table-column prop="taskClass" label="任务类型" align="center">
            </el-table-column>
            <el-table-column prop="domainUrl" label="域名链接" align="center">
            </el-table-column>
            <el-table-column prop="keywords" label="关键词" align="center">
            </el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="scope">
                    <el-button @click="handleClickView(scope.row)" type="text" size="small">查看</el-button>
                    <el-button @click="handleClickDownload(scope.row)" type="text" size="small">导出</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    methods: {
        handleClickView(row) {
            console.log(row);
            this.$router.push({
                name: 'CollectView', // 目标路由的名称
                params: {
                    taskName: row.taskName
                } // 携带的参数对象
            });
        },
    },
    data() {
        return {
            tableData: [{
                taskName: '采集任务1',
                createUser: '王小虎',
                taskClass: '域名爬虫',
                domainUrl: 'www.baidu.com',
                keywords: '变电站;开关;发电厂'
            }, {
                taskName: '采集任务2',
                createUser: '王小虎',
                taskClass: '域名爬虫',
                domainUrl: 'www.baidu.com',
                keywords: '变电站;开关'
            }, {
                taskName: '采集任务3',
                createUser: '王小虎',
                taskClass: '域名爬虫',
                domainUrl: 'www.baidu.com',
                keywords: '变电站;开关;发电厂'
            }]
        }
    }
}
</script>

<style></style>